import axios from '@/utils/request';


/**
 * 订单统计
 */
 export async function QueryOrderStatisticsView(params) {
    const res = await axios.post('/DefaultStatistics/QueryOrderStatisticsView',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 销售出库占比分析
 */
export async function QuerySaleOutOrderProportionStatisticsView(params) {
    const res = await axios.post('/DefaultStatistics/QuerySaleOutOrderProportionStatisticsView',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 订单交货提醒
 */
export async function QuerySaleDeliveryRemindStatisticsView() {
    const res = await axios.post('/DefaultStatistics/QuerySaleDeliveryRemindStatisticsView');
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 销售趋势分析
 */
export async function QuerySaleTrendStatisticsView(params) {
    const res = await axios.post('/DefaultStatistics/QuerySaleTrendStatisticsView',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 产品排名统计
 */
export async function QuerySaleProductRankStatisticsView(params) {
    const res = await axios.post('/DefaultStatistics/QuerySaleProductRankStatisticsView',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 安全库存预警
 */
export async function QuerySafetystockRemindStatisticsView() {
    const res = await axios.post('/DefaultStatistics/QuerySafetystockRemindStatisticsView');
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 采购分析
 */
export async function QueryPurOrderStatisticsView(params) {
    const res = await axios.post('/DefaultStatistics/QueryPurOrderStatisticsView',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 采购发货提醒
 */
export async function QueryPurDeliveryRemindStatisticsView() {
    const res = await axios.post('/DefaultStatistics/QueryPurDeliveryRemindStatisticsView');
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}





